<!DOCTYPE html>
<html lang="en">
<head>
	<include data="head.html">
	<title>主页</title>
	<style>
	.container:first-child{margin-top: 20px;margin-bottom: 20px;}
	.panel-container{box-shadow: none;}
	.panel{box-shadow: none;-webkit-box-shadow:none;}
	.panel-content .media{border-bottom: none;}
	.panel-content .media-body{margin-top: -65px;}
	.panel-content .media-left{height: 48px;}
	.panel-content .media-left .media-icon{height: 40px;padding-top: 2px;padding-left: 7px;}
	#post-latest, #comment-latest{max-height: 343px;}
	#post-latest .panel-body, #comment-latest .panel-body{padding-top: 10px;}
	#file-latest, #server-info{max-height: 213px;}
	#file-latest .panel-content:last-child{margin-bottom: -8px !important;}
	#file-latest .panel-body{padding-top: 19px;padding-bottom: 18px;}
	/*#comment-latest .panel-body{padding-top: 13px;padding-bottom: 14px;}*/
	</style>
</head>
<body data-menu="home" style="overflow-x: hidden;">
	<div class="container grid-container">
		<div class="grid">
			<a href="users.html">
				<div class="grid-content">
					<div class="grid-icon"><i class="glyphicon glyphicon-user"></i></div>
					<div class="grid-title">用户</div>
					<div class="grid-details">
						<if data="get_multi_user(array('limit'=>5))">
							{!get_multi_user(0)}
							{_user('total')}
							<else>
								0
							</else>
						</if>
					</div>
				</div>
			</a>
		</div>
		<div class="grid">
			<a title="查看详情" href="categories.html">
				<div class="grid-content">
					<div class="grid-icon"><i class="glyphicon glyphicon-list-alt"></i></div>
					<div class="grid-title">分类目录</div>
					<div class="grid-details">
					 	<if data="get_multi_category(array('limit'=>5))">
					 		{!get_multi_category(0)}
					 		{_category('total')}
					 		<else>
					 			0
					 		</else>
					 	</if>
					</div>
				</div>
			</a>
		</div>
		<div class="grid">
			<a title="查看详情" href="posts.html">
				<div class="grid-content">
					<div class="grid-icon"><i class="glyphicon glyphicon-book"></i></div>
					<div class="grid-title">文章</div>
					<div class="grid-details">
						<if data="get_multi_post(array('orderby'=>'post_time', 'sequence'=>'desc', 'limit'=>5))">
							{!get_multi_post(0)}
							{_post('total')}
							<else>
								0
							</else>
						</if>
					</div>
				</div>
			</a>
		</div>
		<div class="grid">
			<a title="查看详情" href="comments.html">
				<div class="grid-content">
					<div class="grid-icon"><i class="glyphicon glyphicon-comment"></i></div>
					<div class="grid-title">评论</div>
					<div class="grid-details">
						<if data="get_multi_comment(array('orderby'=>'comment_time', 'sequence'=>'desc', 'limit'=>5))">
							{!get_multi_comment(0)}
							{_comment('total')}
							<else>
								0
							</else>
						</if>
					</div>
				</div>
			</a>
		</div>
	</div>
	<div class="container panel-container">
		<div class="panel-row">
			<div class="panel" id="post-latest">
				<div class="panel-heading">
					<h4 class="panel-title">最新文章<a title="查看更多" href="posts.html?orderby=post_time&sequence=desc"><i class="glyphicon glyphicon-arrow-right"></i></a></h4>
				</div>
				<div class="panel-body">
					<while data="get_multi_post()">
						<div class="panel-content">
							<h4>
								<a title="查看详情" href="posts.html?post_id={post_id()}">
									{post_title()}
								</a>
								<small>
									{date('Y-m-d', post_time())} 于【{post_category('alias') ?: post_category('name')}】
								</small>
							</h4>
							<p>
								{get_post_desc()}
							</p>
						</div>
					</while>
				</div>
			</div>
			<div class="panel" id="comment-latest">
				<div class="panel-heading">
					<h4 class="panel-title">最新评论<a title="查看更多" href="comments.html?orderby=comment_time&sequence=desc"><i class="glyphicon glyphicon-arrow-right"></i></a></h4>
				</div>
				<div class="panel-body">
					<while data="get_multi_comment()">
						<div class="panel-content">
							<div class="media">
								<a title="查看详情" href="comments.html?comment_id={comment_id()}">
									<div class="media-left">
										<if data="comment_user('avatar')">
											<img src="{get_user_avatar(64, comment_user('avatar'))}" alt="用户头像">
											<else>
												<i class="glyphicon glyphicon-user media-icon"></i>
											</else>
										</if>
									</div>
									<div class="media-body">
										<h4 class="media-heading">
											{comment_user('nickname') ?: comment_user('name')} 
											<small>{date('Y-m-d', comment_time())} 于《{comment_post('title')}》</small>
										</h4>
										<p>
											<if data="comment_parent()">
												@{comment_parent('user_nickname') ?: comment_parent('user_name')} 
											</if>
											{get_comment_desc()}
										</p>
									</div>
								</a>
							</div>
						</div>
					</while>
				</div>
			</div>
		</div>
		<div class="panel-row">
			<div class="panel" id='file-latest'>
				<div class="panel-heading">
					<h4 class="panel-title">最新文件<a title="查看更多" href="files.html" ><i class="glyphicon glyphicon-arrow-right"></i></a></h4>
				</div>
				<div class="panel-body"> 
					{!$i = 0}
					<while data="get_multi_file(array('sequence'=>'desc'))">
						<if data="!($i % 5)">
							<div class="panel-content" style="margin: 0 -5px;">
						</if>
							<div class="img-container">
								<a title="查看详情" href="files.html?file_id={file_id()}">
									{admin_get_file_icon(128)}
								</a>
							</div>
						<if data="($i % 5) == 4">
							</div>
						</if>
						{!$i++}
					</while>
					<if data="$i != 0 && (($i > 5 && $i <= 9) || $i <= 4)">
						</div>
					</if>
				</div>
			</div>
			<div class="panel" id="server-info">
				<div class="panel-heading">
					<h4 class="panel-title">服务器</h4>
				</div>
				<div class="panel-body">
					<div class="panel-content">
						<p>软件版本: <a target="_blank" href="{$VERSION_URLS['modcms']}">ModCMS {CMS_VERSION}</a>, based on <a target="_blank" href="{$VERSION_URLS['modphp']}">ModPHP {MOD_VERSION}</a></p>
					</div>
					<div class="panel-content">
						<p>主机类型: {$_SERVER['SERVER_SOFTWARE']}</p>
					</div>
					<div class="panel-content">
						<p>磁盘信息: {$freeSpace} / {$totalSpace}</p>
					</div>
					<div class="panel-content">
						<p>上传限制: {$uploadLimit}</p>
					</div>
					<div class="panel-content">
						<p>MySQL 版本: {mysql::info('server_info')}</p>
					</div>
					<div class="panel-content">
						<p>数据库已用空间: {$MySQLUsed}</p>
					</div>
				</div>
			</div>
		</div>
	</div>
	<include data="foot.html">
	<script>
		$(function(){
			$.showHelp('<p>ModCMS 提供了非常丰富且易于定制的功能，你可以轻易增加或修改自己需要的模块，删除不必要的模块，随心所欲定制自己想要的功能。</p><p>更多详情请阅读 <a href="readme.txt">Readme 说明</a>或者访问 <a target="_blank" href="http://modphp.hyurl.com/">ModPHP 官方网站</a>。</p>')
		});
	</script>
</body>
</html>